package com.hpeu_12.day1223;

import java.util.Scanner;

/**
 * 第四题：输入10个整数存入数组，然后采冒泡排序后将其输出。
 * @author Administrator
 *
 */
public class HomeWork04 {

	public static void main(String[] args) {
		System.out.println("请输入10 个整数:");
		Scanner scanner = new Scanner(System.in);
		int arr[]= new int[10];
		for (int i = 0; i < arr.length; i++) {
			arr[i]=scanner.nextInt();
		}
		for (int i = 0; i < arr.length-1; i++) {
			for (int j = 0; j < arr.length-1-i; j++) {
				if (arr[j]>arr[j+1]) {
					int tem = arr[j+1];
					arr[j+1]=arr[j];
					arr[j]=tem;
				}
			}
		}
		for(int arrs:arr){
			System.out.print(arrs+" ");
		}
	}

}
